package com.zhi.dao;

import com.zhi.entity.ALeaveInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/**
 * 请假记录子表dao层,与数据库交互
 */
public interface LeaveInfoRepository extends JpaRepository<ALeaveInfo, Integer>{

    /**
     * 根据请假编号删除请假流程子表
     * Query注解执行删除、修改时，需要加上Modifying、Transactional注解
     * @param id
     */
    @Modifying
    @Transactional
    @Query(value = "delete from aLeave_Info where leave_Id = ?1",nativeQuery = true)
    public void deleteByLeaveId(Integer id);

}
